package org.jeecg.modules.demo.zyExam.zyPaperMultipleChoiceQuestion.mapper;



import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.zyExam.zyPaperMultipleChoiceQuestion.entity.ZyPaperMultipleChoiceQuestion;

import java.util.List;

/**
 * @Description: 题库多选题
 * @Author: jeecg-boot
 * @Date:   2025-07-08
 * @Version: V1.0
 */
public interface ZyPaperMultipleChoiceQuestionMapper extends BaseMapper<ZyPaperMultipleChoiceQuestion> {

    @Select("select id from zy_paper_multiple_choice_question  where subject =#{subject}  order by rand() desc limit #{changeNumber}")
    List<String> findBySubject(String subject, Integer changeNumber);

    @Select("select * from zy_paper_multiple_choice_question where id in" +
            " (select question_code from zy_paper_manage where question_type = 0 and paper_code = #{paperCode})")
    List<ZyPaperMultipleChoiceQuestion> findByIdAndType(String paperCode);
}
